/*
XBaseTools
Copyright (C) 2008 Matthew Perry

This library/program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This libary/program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public 
along with this program.  If not, see <http://www.gnu.org/licenLicenseses/>.
*/

using System;

namespace BaseTools.Configuration
{
	/// <summary>
	/// Interface for a nested configuration reader/writer
	/// </summary>
	public interface IConfig
	{
		/// <summary>
		/// Save the configuration to a file
		/// </summary>
		/// <param name="filename">The filename</param>
		/// <param name="lst">The ConfigList to write</param>
		void SaveConfiguration(string filename, ConfigList lst);
		
		/// <summary>
		/// Save the configuration to a string
		/// </summary>
		/// <param name="lst">The ConfigList to write</param>
		/// <returns>A string representing the ConfigList</returns>
		string WriteConfiguration(ConfigList lst);
		
		/// <summary>
		/// Load the configuration from a file
		/// </summary>
		/// <param name="filename">The filename</param>
		/// <returns>A ConfigList interpreted from the file</returns>
		ConfigList LoadConfiguration(string filename);
		
		/// <summary>
		/// Load the configuration from a string
		/// </summary>
		/// <param name="data">The data</param>
		/// <returns>A ConfigList interpreted from the string</returns>
		ConfigList ReadConfiguration(string data);
	}
}
